# uname WX_orDEk52jy_bfTzQkFH_Uf4r7SJAA
# unotify 9668addbb3666f7330637f7fe39799ef

import requests
# 模拟登录获取cookie
url = 'https://vip.hdbz.net/auth/ajaxlogin'
data = {
    "username":"15138001200",
    "password":"pckzzy101"
}
response = requests.post(url,data=data)
print(response.status_code)
print(response.cookies)

# 直接使用cookiejar
# home_res  =requests.get("https://vip.hdbz.net/site/FavoriteList?page=1&limit=10",cookies=response.cookies)
# print(home_res.json())

# 构造cookie字典
cookies={
    "uid":response.cookies.get('uid'),
    "uid":response.cookies.get('uid'),
    "uid":response.cookies.get('uid')
}
# 在headers中使用cookie
# 如果不能轻松的模拟登录获取cookie， 则可以在浏览器登录之后 手动复制cookie
# 但是随着cookie过期则需要再次手动赋值
headers = {
    "cookie":"Hm_lvt_c555701034a208b65b9f7b81d7aa331f=1743492416; HMACCOUNT=2376170B72954748; Hm_lpvt_c555701034a208b65b9f7b81d7aa331f=1743492429; wxopenid=orDEk52jy_bfTzQkFH_Uf4r7SJAA; openid=orDEk52jy_bfTzQkFH_Uf4r7SJAA; isVip=0; userNickname=.; userimg=https%3A%2F%2Fvip.hdbz.net%2Favatar%2F2025%2F04%2F01%2Flogo_18606.jpg; uname=WX_orDEk52jy_bfTzQkFH_Uf4r7SJAA; unotify=9668addbb3666f7330637f7fe39799ef; uid=18606"
}
response = requests.get('https://vip.hdbz.net/site/FavoriteList?page=1&limit=10',headers=headers)
for img in response.json()['data']:
    print(img['favoriteId'],img['favoriteThumb'],img['favoriteTitle'])